{% extends 'base.html' %}
{% load static %}
{% block css %}
    <style>
        * {
            margin:0;
            padding: 0;
        }
        .header {
            width: 100%;
            height: 60px;
            background-color: #369;
        }
        .header .title {
            font-size: 18px;
            font-weight: 100;
            line-height: 60px;
            color: white;
            margin-left: 15px;
            margin-top: -10px;
        }
        .backend {
            float:right;
            color:white;
            text-decoration: none;
            font-size:14px;
            margin-right: 10px;
            margin-top: 10px;
        }
        .pub_info {
            margin-top: 10px;
            color:darkgray;
        }
    </style>
{% endblock %}

{% block header %}
    <div class="header">
        <div class="content">
            <p class="title">
                <span>{{ blog.title }}</span>
                <a href="#" class="backend">管理</a>
            </p>
        </div>
    </div>

{% endblock %}

{% block content %}
    <div class="container">
        <div class="row">
            <div class="col-md-3">
                <div class="panel panel-warning">
                    <div class="panel-heading">随笔分类</div>
                    <div class="panel-body">
                        {% for cate in cate_list %}
                            <p><a href="{% url 'home_site2' username 'category' cate.0 %}">{{ cate.0 }}</a> ({{ cate.1 }})</p>
                        {% endfor %}
                    </div>
                </div>
                <div class="panel panel-danger">
                    <div class="panel-heading">文章标签</div>
                    <div class="panel-body">
                        {% for tag in tag_list %}
                            <p><a href="{% url 'home_site2' username 'tag' tag.0 %}">{{ tag.0 }}</a> ({{ tag.1 }})</p>
                        {% endfor %}
                    </div>
                </div>

                <div class="panel panel-success">
                    <div class="panel-heading">随笔归档</div>
                    <div class="panel-body">
                        {% for data in article_month_count %}
                            <p><a href="{% url 'home_site2' username 'archive' data.0|date:'Y-m' %}">
                                {{ data.0 |date:"Y-m" }}</a>
                                ({{ data.1 }})</p>
                        {% endfor %}
                    </div>
                </div>

            </div>

            <div class="col-md-9">
                <div class="article_list">
                    {% for article in article_list %}
                        <div class="article-item small clearfix">
                            <h5><a href="{% url 'article_detail' username article.pk %}">{{ article.title }}</a></h5>
                            <div class="article-desc">

                                <span class="media-left">
                                    {{ article.desc }}
                                </span>

                            </div>

                            <div class="small pub_info pull-right">

                                <span>发布于&nbsp;&nbsp;{{ article.create_time |date:"Y-m-d H:i"}}</span>&nbsp;&nbsp;
                                <span class="glyphicon glyphicon-comment"></span>评论（{{ article.comment_count }}）&nbsp;&nbsp;
                                <span class="glyphicon glyphicon-thumbs-up"></span>点赞（{{ article.up_count }}）&nbsp;&nbsp;
                            </div>
                        </div>
                        <hr>
                    {% endfor %}

                </div>
            </div>

        </div>

    </div>


{% endblock %}